package com.hzdl.house_mgr.mapper;

import com.hzdl.house_mgr.bean.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {

    int insert(Role role);

    int deleteRoleById(Integer roleId);

    int updateRole(Role role);

    Role selectById(Integer roleId);

    /**
     * 查询所有角色
     */
    List<Role> findRoleByWhere(@Param("roleName") String roleName, @Param("roleDesc") String roleDesc);

    Integer getCountByWhere(@Param("roleName") String roleName, @Param("roleDesc") String roleDesc);


    int deleteRoleMenuByRoleId(@Param("rid") Integer roleId);

    int insRoleMenuByRoleId(@Param("rid") Integer rid, @Param("arr") Integer[] arr);

    List<Role> findAll();

    List<Role> findRoleByUserId(Integer userId);
}
